﻿using FinancePortal.Business.Infraestructure;
using FinancePortal.Business.Repository;
using FinancePortal.Domain.Model;
using System.Collections.Generic;
using System.Linq;

namespace FinancePortal.Business.Implementation
{
    public class ActivityRepository : RepositoryBase<Activity>, IActivityRepository
    {
        public ActivityRepository(IUnitOfWork uow)
            : base(uow)
        { }

        public IQueryable<Activity> GetByArea(int? areaId) //IList<int> areas)
        {
            return (from a in GetAll()
                    //join a in areas on ac.Area.Id equals a.Id
                    where areaId == 1 || a.Area.Id == areaId //areas.Contains(a.AreaId) //.Id)
                    select a);
        }
    }
}
